<?php
// Requestor
use Fox\Common\Customer;
use Fox\Html\DropList;
$droplist = new DropList(array("inquiry_author","sourceid"),true,false,true);

$agencyId = Xview::instance()->val("agency");
$role =  Xview::instance()->val("role");
if(!empty($agencyId))
{
	try {
		$customer = \Fox\Dao::load(Customer::className(),$agencyId);
		/* @var $customer Customer */
		$fragments[] = new Fox\Dao\SqlFragment("p.role = ? ",array($role));
		$partners = $customer->customerPartners();

		$droplist->options($partners,
		Fox\Generator::useAttribute('customerid'),
		Fox\Generator::concatenate(Fox\Generator::useAttribute('name1'), Fox\Generator::useAttribute('function')," - ")
		);

	}
	catch (Fox\Object\Exception\NotExist $e)
	{

	}
}
echo $droplist->renderOptions();